using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace SideShow.Channel.Messages
{
    [Serializable]
    class AddApplicationMessage : Message
    {
        private SideShowApplication _app;

        public AddApplicationMessage()
        {
        }

        public AddApplicationMessage(SideShowApplication app)
            : base(ChannelMessages.AddApplication)
        {
            _app = app;
        }

        public SideShowApplication Application
        {
            get { return _app; }
        }

        protected internal override void SerializeObject(BinaryWriter writer)
        {
            base.SerializeObject(writer);
            _app.SerializeObject(writer);
        }

        protected internal override void DeserializeObject(BinaryReader reader)
        {
            base.DeserializeObject(reader);
            _app = new SideShowApplication(reader);
            
        }

    }
}
